//
//  HWDownloader.h
//  HomeWork
//
//  Created by apple on 2017/10/26.
//  Copyright © 2017年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "Singleton.h"
typedef void(^CompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, NSURL * _Nullable imageURL);
@interface HWDownloader : NSObject
SingletonH;

/**
 根据url下载图片

 @param url 图片的URL地址
 @param completion 下载完成的回调
 */
- (void)downloadWithUrl:(nullable NSURL *)url completion:(nullable CompletionBlock)completion;

/** 取消所有下载操作 */
- (void)cancelAllDownload;
@end
